﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

/// <summary>
///AdvertiseDAL 的摘要说明
/// </summary>
public class AdvertiseDAL
{
    /// <summary>
    /// 查询广告
    /// </summary>
    /// <returns></returns>
    public Advertise Get(string key)
    {
        Tools tool = new Tools();
        tool.AddSqlParameter("key", SqlDbType.VarChar, key);
        Advertise a = null;
        using (SqlDataReader tb = Emoney.DataAccess.SqlHelper.ExecuteReader(DBConn.Con_emweb_new, System.Data.CommandType.StoredProcedure, "GetAdvertiseByKey", tool.GetSqlParameters()))
        {
            if (tb.Read())
            {
                a = new Advertise();
                a.AdvertiseId = Tools.GetString(tb["AdvertiseId"]);
                a.Content = Tools.GetString(tb["content"]);
                a.Link = Tools.GetString(tb["link"]);
            }
        }
        return a;
    }
}